<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="lib/angular.min.js"></script>
	<script type='text/javascript' src='lib/angular-router.js'></script>
</head>
<body ng-app="myApp">
			<div ng-controller="MainCtrl" ng-bind="mod">
			    
			</div>
			<div ng-controller="sideCtrl" ng-bind="mod">
				
			</div>
      		<div ng-controller="overCtrl" ng-bind="mod">
      			
      		</div>
      
      <script>
			var app = angular.module('myApp', []);
			app.factory('mod', function(){
			    return {
			    	name:'factory',
			    	setname:function(a){
			    		this.name = a;
			    	}
			    };
			});
			app.service('mod2', function(){
				var self = this;
				this.name = 'service';
				this.setname = function(a){
					self.name = a
				};
			})

			app.provider('mod3',function(){
				this.$get = function(){
					var obj = {
						name:'provider'
					}
					return obj;
				}

			})



			app.controller('MainCtrl', function($scope, mod) {
				$scope.mod = mod.name; 
							});
			app.controller('sideCtrl', function($scope, mod2) {
				$scope.mod = mod2.name; 
			  
			});
			app.controller('overCtrl',function($scope,mod3){
				$scope.mod = mod3.name; 	
			})
		</script>
			      
		</body>
			</html>